swapcount = 0
a = [-212, 317, -485, 319, 121, 60]
print "len(a) = ", len(a) 
sorted = False
while( not sorted ):
	sorted = True
	print "odd"
	for i in range(1, len(a)-1, 2):
		print i,
		if a[i] > a[i+1]:
			print "swap", a[i], "and", a[i+1]
			sorted = False
			temp = a[i]
			a[i] = a[i+1]
			a[i+1] = temp
			swapcount += 1
		else: print "no swap"
	print "even"
	for i in range(0, len(a)-1, 2):
		print i,
		if a[i] > a[i+1]:
			print "swap", a[i], "and", a[i+1]
			sorted = False
			temp = a[i]
			a[i] = a[i+1]
			a[i+1] = temp
			swapcount += 1
		else: print "no swap"
print a
print "swapcount is ", swapcount
